#include<bits/stdc++.h>

using namespace std;

const int maxn = 2e6 + 200;
typedef long long ll;
ll m, n, p, q;

//O(sqrt(n))数论算法：因子分解+解方程
int main() {
    cin >> m;
    m *= 2;
    for (ll i = sqrt(m); i >= 1; i--) {
        if (m % i != 0)continue;
        ll j = m / i;
        q = (j + i - 1) / 2;
        p = (j - i + 1) / 2;
        if (q > p && (p + q) * (q - p + 1) == m) {
            cout << p << " " << q << endl;
        }
    }
    return 0;
}